# num1 = 1
# num2 = 1
# res = num1 + num2
# for i in range(17):
#     num1,num2 = num2,res
#     res = num1 + num2
# print(res)


# num = float(input("请输入一个正浮点数"))
# if int(num*10)%10 < 5:
#     print(int(num//1))
# else:
#     print(int(num//1+1))


# for x in range(21):
#     for y in range(34):
#         for z in range(0,300,3):
#             if x+y+z==100 and 5*x+3*y+z/3==100:
#                 print(x,y,z)


# for a in range(9):
#     for b in range(7):
#         for c in range(4):
#             if a+b+c==8:
#                 print(a,b,c)

#循环取模问题
a = int(input("请输入列车正点到站时间："))
b = int(input("请输入列车延误小时数："))
c = (a+b)%24
print(c)
